<form action="{php echo web_url('distribution/dissysbase/changeleadid')}" method="post" class="form-horizontal form form-validate">
    <div class="modal-dialog" style="z-index: 50;">
        <div class="modal-content" style="max-height: 1000px;">
            <div class="modal-header">
                <button data-dismiss="modal" class="close" type="button">×</button>
                <h4 class="modal-title">修改用户上级</h4>
            </div>
            <div class="modal-body" style="margin-left: 100px;">
                <div class="form-group">
                    <label class="col-sm-2 control-label">上级</label>
                    <div class="col-md-7">
                        <select name="leadid" class="form-control col-sm-7 col-xs-6 chosen-select" style="width: 100%;">
                            <option value="{$distri['leadid']}" selected="selected">{$distri['leadname']}</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <input type="hidden" name="id" id="id" value="{$id}" />
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="submit" class="btn btn-primary">提交更改</button>
            </div>
        </div>
    </div>
</form>
<script>
    $(document).on('show.bs.modal', '.modal', function(event) {
        $(this).appendTo($('body'));
    }).on('shown.bs.modal', '.modal.in', function(event) {
        setModalsAndBackdropsOrder();
    }).on('hidden.bs.modal', '.modal', function(event) {
        setModalsAndBackdropsOrder();
    });


    function setModalsAndBackdropsOrder() {
        var modalZIndex = 1040;
        $('.modal.in').each(function(index) {
            var $modal = $(this);
            modalZIndex++;
            $modal.css('zIndex', modalZIndex);
            $modal.next('.modal-backdrop.in').addClass('hidden').css('zIndex', modalZIndex - 1);
        });
        $('.modal.in:visible:last').focus().next('.modal-backdrop.in').removeClass('hidden');
    }
</script>
